<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Reline::Config - reline: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-add_default_key_binding">#add_default_key_binding</a>
    <li ><a href="#method-i-add_default_key_binding_by_keymap">#add_default_key_binding_by_keymap</a>
    <li ><a href="#method-i-add_oneshot_key_binding">#add_oneshot_key_binding</a>
    <li ><a href="#method-i-bind_key">#bind_key</a>
    <li ><a href="#method-i-bind_variable">#bind_variable</a>
    <li ><a href="#method-i-default_inputrc_path">#default_inputrc_path</a>
    <li ><a href="#method-i-editing_mode">#editing_mode</a>
    <li ><a href="#method-i-editing_mode-3D">#editing_mode=</a>
    <li ><a href="#method-i-editing_mode_is-3F">#editing_mode_is?</a>
    <li ><a href="#method-i-handle_directive">#handle_directive</a>
    <li ><a href="#method-i-inputrc_path">#inputrc_path</a>
    <li ><a href="#method-i-key_bindings">#key_bindings</a>
    <li ><a href="#method-i-key_notation_to_code">#key_notation_to_code</a>
    <li ><a href="#method-i-keymap">#keymap</a>
    <li ><a href="#method-i-parse_keyseq">#parse_keyseq</a>
    <li ><a href="#method-i-read">#read</a>
    <li ><a href="#method-i-read_lines">#read_lines</a>
    <li ><a href="#method-i-reset">#reset</a>
    <li ><a href="#method-i-reset_default_key_bindings">#reset_default_key_bindings</a>
    <li ><a href="#method-i-reset_oneshot_key_bindings">#reset_oneshot_key_bindings</a>
    <li ><a href="#method-i-retrieve_string">#retrieve_string</a>
    <li ><a href="#method-i-seven_bit_encoding-3F">#seven_bit_encoding?</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Reline::Config">
    <h1 id="class-Reline::Config" class="class">
      class Reline::Config
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="KEYSEQ_PATTERN">KEYSEQ_PATTERN
          <dd>
          <dt id="VARIABLE_NAMES">VARIABLE_NAMES
          <dd>
          <dt id="VARIABLE_NAME_SYMBOLS">VARIABLE_NAME_SYMBOLS
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-autocompletion" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">autocompletion</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-test_mode" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">test_mode</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 50</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
  <span class="ruby-ivar">@additional_key_bindings</span> = {} <span class="ruby-comment"># from inputrc</span>
  <span class="ruby-ivar">@additional_key_bindings</span>[<span class="ruby-value">:emacs</span>] = {}
  <span class="ruby-ivar">@additional_key_bindings</span>[<span class="ruby-value">:vi_insert</span>] = {}
  <span class="ruby-ivar">@additional_key_bindings</span>[<span class="ruby-value">:vi_command</span>] = {}
  <span class="ruby-ivar">@oneshot_key_bindings</span> = {}
  <span class="ruby-ivar">@skip_section</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@if_stack</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@editing_mode_label</span> = <span class="ruby-value">:emacs</span>
  <span class="ruby-ivar">@keymap_label</span> = <span class="ruby-value">:emacs</span>
  <span class="ruby-ivar">@keymap_prefix</span> = []
  <span class="ruby-ivar">@key_actors</span> = {}
  <span class="ruby-ivar">@key_actors</span>[<span class="ruby-value">:emacs</span>] = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">KeyActor</span><span class="ruby-operator">::</span><span class="ruby-constant">Emacs</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@key_actors</span>[<span class="ruby-value">:vi_insert</span>] = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">KeyActor</span><span class="ruby-operator">::</span><span class="ruby-constant">ViInsert</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@key_actors</span>[<span class="ruby-value">:vi_command</span>] = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">KeyActor</span><span class="ruby-operator">::</span><span class="ruby-constant">ViCommand</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@vi_cmd_mode_string</span> = <span class="ruby-string">&#39;(cmd)&#39;</span>
  <span class="ruby-ivar">@vi_ins_mode_string</span> = <span class="ruby-string">&#39;(ins)&#39;</span>
  <span class="ruby-ivar">@emacs_mode_string</span> = <span class="ruby-string">&#39;@&#39;</span>
  <span class="ruby-comment"># https://tiswww.case.edu/php/chet/readline/readline.html#IDX25</span>
  <span class="ruby-ivar">@history_size</span> = <span class="ruby-value">-1</span> <span class="ruby-comment"># unlimited</span>
  <span class="ruby-ivar">@keyseq_timeout</span> = <span class="ruby-value">500</span>
  <span class="ruby-ivar">@test_mode</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@autocompletion</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@convert_meta</span> = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">seven_bit_encoding?</span>(<span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">encoding</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-add_default_key_binding" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_default_key_binding</span><span
                                class="method-args">(keystroke, target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_default_key_binding-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 172</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_default_key_binding</span>(<span class="ruby-identifier">keystroke</span>, <span class="ruby-identifier">target</span>)
  <span class="ruby-ivar">@key_actors</span>[<span class="ruby-ivar">@keymap_label</span>].<span class="ruby-identifier">default_key_bindings</span>[<span class="ruby-identifier">keystroke</span>] = <span class="ruby-identifier">target</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_default_key_binding_by_keymap" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_default_key_binding_by_keymap</span><span
                                class="method-args">(keymap, keystroke, target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_default_key_binding_by_keymap-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 168</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_default_key_binding_by_keymap</span>(<span class="ruby-identifier">keymap</span>, <span class="ruby-identifier">keystroke</span>, <span class="ruby-identifier">target</span>)
  <span class="ruby-ivar">@key_actors</span>[<span class="ruby-identifier">keymap</span>].<span class="ruby-identifier">default_key_bindings</span>[<span class="ruby-identifier">keystroke</span>] = <span class="ruby-identifier">target</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_oneshot_key_binding" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_oneshot_key_binding</span><span
                                class="method-args">(keystroke, target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_oneshot_key_binding-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 160</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_oneshot_key_binding</span>(<span class="ruby-identifier">keystroke</span>, <span class="ruby-identifier">target</span>)
  <span class="ruby-ivar">@oneshot_key_bindings</span>[<span class="ruby-identifier">keystroke</span>] = <span class="ruby-identifier">target</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-bind_key" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">bind_key</span><span
                                class="method-args">(key, func_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="bind_key-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 342</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bind_key</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">func_name</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\A&quot;(.*)&quot;\z/</span>
    <span class="ruby-identifier">keyseq</span> = <span class="ruby-identifier">parse_keyseq</span>(<span class="ruby-node">$1</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">keyseq</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">func_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/&quot;(.*)&quot;/</span>
    <span class="ruby-identifier">func</span> = <span class="ruby-identifier">parse_keyseq</span>(<span class="ruby-node">$1</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">func</span> = <span class="ruby-identifier">func_name</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-value">?-</span>, <span class="ruby-value">?_</span>).<span class="ruby-identifier">to_sym</span> <span class="ruby-comment"># It must be macro.</span>
  <span class="ruby-keyword">end</span>
  [<span class="ruby-identifier">keyseq</span>, <span class="ruby-identifier">func</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-bind_variable" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">bind_variable</span><span
                                class="method-args">(name, value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="bind_variable-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 259</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bind_variable</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;history-size&#39;</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-ivar">@history_size</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">value</span>)
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">ArgumentError</span>
      <span class="ruby-ivar">@history_size</span> = <span class="ruby-value">500</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;bell-style&#39;</span>
    <span class="ruby-ivar">@bell_style</span> =
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">value</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;none&#39;</span>, <span class="ruby-string">&#39;off&#39;</span>
        <span class="ruby-value">:none</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;audible&#39;</span>, <span class="ruby-string">&#39;on&#39;</span>
        <span class="ruby-value">:audible</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;visible&#39;</span>
        <span class="ruby-value">:visible</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-value">:audible</span>
      <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;comment-begin&#39;</span>
    <span class="ruby-ivar">@comment_begin</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;completion-query-items&#39;</span>
    <span class="ruby-ivar">@completion_query_items</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_i</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;isearch-terminators&#39;</span>
    <span class="ruby-ivar">@isearch_terminators</span> = <span class="ruby-identifier">retrieve_string</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;editing-mode&#39;</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">value</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;emacs&#39;</span>
      <span class="ruby-ivar">@editing_mode_label</span> = <span class="ruby-value">:emacs</span>
      <span class="ruby-ivar">@keymap_label</span> = <span class="ruby-value">:emacs</span>
      <span class="ruby-ivar">@keymap_prefix</span> = []
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;vi&#39;</span>
      <span class="ruby-ivar">@editing_mode_label</span> = <span class="ruby-value">:vi_insert</span>
      <span class="ruby-ivar">@keymap_label</span> = <span class="ruby-value">:vi_insert</span>
      <span class="ruby-ivar">@keymap_prefix</span> = []
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;keymap&#39;</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">value</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;emacs&#39;</span>, <span class="ruby-string">&#39;emacs-standard&#39;</span>
      <span class="ruby-ivar">@keymap_label</span> = <span class="ruby-value">:emacs</span>
      <span class="ruby-ivar">@keymap_prefix</span> = []
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;emacs-ctlx&#39;</span>
      <span class="ruby-ivar">@keymap_label</span> = <span class="ruby-value">:emacs</span>
      <span class="ruby-ivar">@keymap_prefix</span> = [<span class="ruby-value">?\C-x</span>.<span class="ruby-identifier">ord</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;emacs-meta&#39;</span>
      <span class="ruby-ivar">@keymap_label</span> = <span class="ruby-value">:emacs</span>
      <span class="ruby-ivar">@keymap_prefix</span> = [<span class="ruby-value">?\e</span>.<span class="ruby-identifier">ord</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;vi&#39;</span>, <span class="ruby-string">&#39;vi-move&#39;</span>, <span class="ruby-string">&#39;vi-command&#39;</span>
      <span class="ruby-ivar">@keymap_label</span> = <span class="ruby-value">:vi_command</span>
      <span class="ruby-ivar">@keymap_prefix</span> = []
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;vi-insert&#39;</span>
      <span class="ruby-ivar">@keymap_label</span> = <span class="ruby-value">:vi_insert</span>
      <span class="ruby-ivar">@keymap_prefix</span> = []
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;keyseq-timeout&#39;</span>
    <span class="ruby-ivar">@keyseq_timeout</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_i</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;show-mode-in-prompt&#39;</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">value</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;off&#39;</span>
      <span class="ruby-ivar">@show_mode_in_prompt</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;on&#39;</span>
      <span class="ruby-ivar">@show_mode_in_prompt</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@show_mode_in_prompt</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;vi-cmd-mode-string&#39;</span>
    <span class="ruby-ivar">@vi_cmd_mode_string</span> = <span class="ruby-identifier">retrieve_string</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;vi-ins-mode-string&#39;</span>
    <span class="ruby-ivar">@vi_ins_mode_string</span> = <span class="ruby-identifier">retrieve_string</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;emacs-mode-string&#39;</span>
    <span class="ruby-ivar">@emacs_mode_string</span> = <span class="ruby-identifier">retrieve_string</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-operator">*</span><span class="ruby-constant">VARIABLE_NAMES</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">variable_name</span> = <span class="ruby-value">:&quot;@#{name.tr(?-, ?_)}&quot;</span>
    <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">variable_name</span>, <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;1&#39;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;on&#39;</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-editing_mode" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">editing_mode</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="editing_mode-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 87</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">editing_mode</span>
  <span class="ruby-ivar">@key_actors</span>[<span class="ruby-ivar">@editing_mode_label</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-editing_mode-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">editing_mode=</span><span
                                class="method-args">(val)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="editing_mode-3D-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 91</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">editing_mode=</span>(<span class="ruby-identifier">val</span>)
  <span class="ruby-ivar">@editing_mode_label</span> = <span class="ruby-identifier">val</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-editing_mode_is-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">editing_mode_is?</span><span
                                class="method-args">(*val)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="editing_mode_is-3F-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 95</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">editing_mode_is?</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">val</span>)
  <span class="ruby-identifier">val</span>.<span class="ruby-identifier">any?</span>(<span class="ruby-ivar">@editing_mode_label</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-handle_directive" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">handle_directive</span><span
                                class="method-args">(directive, file, no)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="handle_directive-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 229</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">handle_directive</span>(<span class="ruby-identifier">directive</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">no</span>)
  <span class="ruby-identifier">directive</span>, <span class="ruby-identifier">args</span> = <span class="ruby-identifier">directive</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39; &#39;</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">directive</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;if&#39;</span>
    <span class="ruby-identifier">condition</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">args</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;mode&#39;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;term&#39;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;version&#39;</span>
    <span class="ruby-keyword">else</span> <span class="ruby-comment"># application name</span>
      <span class="ruby-identifier">condition</span> = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;Ruby&#39;</span>
      <span class="ruby-identifier">condition</span> = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;Reline&#39;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@if_stack</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">file</span>, <span class="ruby-identifier">no</span>, <span class="ruby-ivar">@skip_section</span>]
    <span class="ruby-ivar">@skip_section</span> = <span class="ruby-operator">!</span><span class="ruby-identifier">condition</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;else&#39;</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@if_stack</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidInputrc</span>, <span class="ruby-node">&quot;#{file}:#{no}: unmatched else&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@skip_section</span> = <span class="ruby-operator">!</span><span class="ruby-ivar">@skip_section</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;endif&#39;</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@if_stack</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidInputrc</span>, <span class="ruby-node">&quot;#{file}:#{no}: unmatched endif&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@skip_section</span> = <span class="ruby-ivar">@if_stack</span>.<span class="ruby-identifier">pop</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;include&#39;</span>
    <span class="ruby-identifier">read</span>(<span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inputrc_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inputrc_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="inputrc_path-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 103</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inputrc_path</span>
  <span class="ruby-keyword">case</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;INPUTRC&#39;</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-string">&#39;&#39;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;INPUTRC&#39;</span>])
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># In the XDG Specification, if ~/.config/readline/inputrc exists, then</span>
  <span class="ruby-comment"># ~/.inputrc should not be read, but for compatibility with GNU Readline,</span>
  <span class="ruby-comment"># if ~/.inputrc exists, then it is given priority.</span>
  <span class="ruby-identifier">home_rc_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&#39;~/.inputrc&#39;</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">home_rc_path</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">home_rc_path</span>)

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">path</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;XDG_CONFIG_HOME&#39;</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-string">&#39;&#39;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-string">&#39;readline/inputrc&#39;</span>)
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">path</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">path</span>) <span class="ruby-keyword">and</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&#39;~/.config/readline/inputrc&#39;</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">path</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">path</span>)

  <span class="ruby-keyword">return</span> <span class="ruby-identifier">home_rc_path</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-key_bindings" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">key_bindings</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="key_bindings-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 152</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">key_bindings</span>
  <span class="ruby-comment"># The key bindings for each editing mode will be overwritten by the user-defined ones.</span>
  <span class="ruby-identifier">kb</span> = <span class="ruby-ivar">@key_actors</span>[<span class="ruby-ivar">@editing_mode_label</span>].<span class="ruby-identifier">default_key_bindings</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-identifier">kb</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-ivar">@additional_key_bindings</span>[<span class="ruby-ivar">@editing_mode_label</span>])
  <span class="ruby-identifier">kb</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-ivar">@oneshot_key_bindings</span>)
  <span class="ruby-identifier">kb</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-key_notation_to_code" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">key_notation_to_code</span><span
                                class="method-args">(notation)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="key_notation_to_code-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 356</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">key_notation_to_code</span>(<span class="ruby-identifier">notation</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">notation</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\\(?:C|Control)-([A-Za-z_])/</span>
    (<span class="ruby-value">1</span> <span class="ruby-operator">+</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">ord</span> <span class="ruby-operator">-</span> <span class="ruby-value">?a</span>.<span class="ruby-identifier">ord</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\\(?:M|Meta)-([0-9A-Za-z_])/</span>
    <span class="ruby-identifier">modified_key</span> = <span class="ruby-node">$1</span>
    <span class="ruby-keyword">case</span> <span class="ruby-node">$1</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/[0-9]/</span>
      <span class="ruby-value">?\M-0</span>.<span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">modified_key</span>.<span class="ruby-identifier">ord</span> <span class="ruby-operator">-</span> <span class="ruby-value">?0</span>.<span class="ruby-identifier">ord</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/[A-Z]/</span>
      <span class="ruby-value">?\M-A</span>.<span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">modified_key</span>.<span class="ruby-identifier">ord</span> <span class="ruby-operator">-</span> <span class="ruby-value">?A</span>.<span class="ruby-identifier">ord</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/[a-z]/</span>
      <span class="ruby-value">?\M-a</span>.<span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">modified_key</span>.<span class="ruby-identifier">ord</span> <span class="ruby-operator">-</span> <span class="ruby-value">?a</span>.<span class="ruby-identifier">ord</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\\(?:C|Control)-(?:M|Meta)-[A-Za-z_]/</span>, <span class="ruby-regexp">/\\(?:M|Meta)-(?:C|Control)-[A-Za-z_]/</span>
  <span class="ruby-comment"># 129 M-^A</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\\(\d{1,3})/</span> <span class="ruby-keyword">then</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>(<span class="ruby-value">8</span>) <span class="ruby-comment"># octal</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\\x(\h{1,2})/</span> <span class="ruby-keyword">then</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>(<span class="ruby-value">16</span>) <span class="ruby-comment"># hexadecimal</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\e&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\e</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\\\&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\\</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\\&quot;&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?&quot;</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\&#39;&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?&#39;</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\a&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\a</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\b&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\b</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\d&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\d</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\f&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\f</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\n&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\n</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\r&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\r</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\t&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\t</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\\v&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-value">?\v</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">else</span> <span class="ruby-identifier">notation</span>.<span class="ruby-identifier">ord</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-keymap" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">keymap</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="keymap-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 99</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">keymap</span>
  <span class="ruby-ivar">@key_actors</span>[<span class="ruby-ivar">@keymap_label</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-parse_keyseq" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">parse_keyseq</span><span
                                class="method-args">(str)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="parse_keyseq-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 390</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse_keyseq</span>(<span class="ruby-identifier">str</span>)
  <span class="ruby-identifier">ret</span> = []
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-constant">KEYSEQ_PATTERN</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">ret</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">key_notation_to_code</span>(<span class="ruby-node">$&amp;</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">ret</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-read" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">read</span><span
                                class="method-args">(file = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="read-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 133</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">read</span>(<span class="ruby-identifier">file</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">file</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">default_inputrc_path</span>
  <span class="ruby-keyword">begin</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:readlines</span>)
      <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">readlines</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">lines</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">readlines</span>(<span class="ruby-identifier">file</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">read_lines</span>(<span class="ruby-identifier">lines</span>, <span class="ruby-identifier">file</span>)
  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">InvalidInputrc</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">warn</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
  <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-read_lines" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">read_lines</span><span
                                class="method-args">(lines, file = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="read_lines-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 182</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">read_lines</span>(<span class="ruby-identifier">lines</span>, <span class="ruby-identifier">file</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">encoding</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Reline</span>.<span class="ruby-identifier">encoding_system_needs</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">l</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-constant">Reline</span>.<span class="ruby-identifier">encoding_system_needs</span>)
      <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UndefinedConversionError</span>
        <span class="ruby-identifier">mes</span> = <span class="ruby-node">&quot;The inputrc encoded in #{lines.first.encoding.name} can&#39;t be converted to the locale #{Reline.encoding_system_needs.name}.&quot;</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">ConfigEncodingConversionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">mes</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">conditions</span> = [<span class="ruby-ivar">@skip_section</span>, <span class="ruby-ivar">@if_stack</span>]
  <span class="ruby-ivar">@skip_section</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@if_stack</span> = []

  <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span>, <span class="ruby-identifier">no</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/\A\s*#/</span>)

    <span class="ruby-identifier">no</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>

    <span class="ruby-identifier">line</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">lstrip</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&#39;$&#39;</span>)
      <span class="ruby-identifier">handle_directive</span>(<span class="ruby-identifier">line</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>], <span class="ruby-identifier">file</span>, <span class="ruby-identifier">no</span>)
      <span class="ruby-keyword">next</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@skip_section</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">line</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^set +([^ ]+) +([^ ]+)/i</span>
      <span class="ruby-identifier">var</span>, <span class="ruby-identifier">value</span> = <span class="ruby-node">$1</span>.<span class="ruby-identifier">downcase</span>, <span class="ruby-node">$2</span>
      <span class="ruby-identifier">bind_variable</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">value</span>)
      <span class="ruby-keyword">next</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\s*(&quot;#{KEYSEQ_PATTERN}+&quot;)\s*:\s*(.*)\s*$/o</span>
      <span class="ruby-identifier">key</span>, <span class="ruby-identifier">func_name</span> = <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>
      <span class="ruby-identifier">keystroke</span>, <span class="ruby-identifier">func</span> = <span class="ruby-identifier">bind_key</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">func_name</span>)
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">keystroke</span>
      <span class="ruby-ivar">@additional_key_bindings</span>[<span class="ruby-ivar">@keymap_label</span>][<span class="ruby-ivar">@keymap_prefix</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">keystroke</span>] = <span class="ruby-identifier">func</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@if_stack</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidInputrc</span>, <span class="ruby-node">&quot;#{file}:#{@if_stack.last[1]}: unclosed if&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@skip_section</span>, <span class="ruby-ivar">@if_stack</span> = <span class="ruby-identifier">conditions</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reset" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 76</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>)
    <span class="ruby-ivar">@editing_mode_label</span> = <span class="ruby-value">:vi_insert</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@additional_key_bindings</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@additional_key_bindings</span>[<span class="ruby-identifier">key</span>].<span class="ruby-identifier">clear</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@oneshot_key_bindings</span>.<span class="ruby-identifier">clear</span>
  <span class="ruby-identifier">reset_default_key_bindings</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reset_default_key_bindings" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset_default_key_bindings</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset_default_key_bindings-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 176</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset_default_key_bindings</span>
  <span class="ruby-ivar">@key_actors</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ka</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">ka</span>.<span class="ruby-identifier">reset_default_key_bindings</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reset_oneshot_key_bindings" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset_oneshot_key_bindings</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset_oneshot_key_bindings-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 164</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset_oneshot_key_bindings</span>
  <span class="ruby-ivar">@oneshot_key_bindings</span>.<span class="ruby-identifier">clear</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-retrieve_string" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">retrieve_string</span><span
                                class="method-args">(str)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="retrieve_string-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 337</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">retrieve_string</span>(<span class="ruby-identifier">str</span>)
  <span class="ruby-identifier">str</span> = <span class="ruby-node">$1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">str</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\A&quot;(.*)&quot;\z/</span>
  <span class="ruby-identifier">parse_keyseq</span>(<span class="ruby-identifier">str</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">chr</span>(<span class="ruby-constant">Reline</span>.<span class="ruby-identifier">encoding_system_needs</span>) }.<span class="ruby-identifier">join</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-default_inputrc_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_inputrc_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_inputrc_path-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 129</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_inputrc_path</span>
  <span class="ruby-ivar">@default_inputrc_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">inputrc_path</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-seven_bit_encoding-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">seven_bit_encoding?</span><span
                                class="method-args">(encoding)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="seven_bit_encoding-3F-source">
            <pre><span class="ruby-comment"># File reline/config.rb, line 398</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">seven_bit_encoding?</span>(<span class="ruby-identifier">encoding</span>)
  <span class="ruby-identifier">encoding</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">US_ASCII</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

